{{include file="public/header.html"}}
<style type="text/css">
ul{ list-style:none;}
li{ line-height:25px; height:25px; margin:5px 0;}
.fl{float:left;}
.fr{float:right;}
.w500{width:50%;}
a{ text-decoration:none; margin:0 5px;}
img{border:1px solid #ccc; width:35px; height:35px; display:block;}
</style>

<div class="fl w500">
{{if $id eq null}}
    <form action="../index.php" method="post" id="form1" enctype="multipart/form-data">
        <ul>
            <li>姓名:<input type="text" name="name" /></li>
            <li>学历:<input type="text" name="xueli" /></li>
            <li>年龄:<input type="text" name="age" /></li>
            <li>上传头像:<input type="file" name="myfile"></li>
            <li>上传文件:<input type="file" name="filedoc" /></li>
            <li><input type="submit" value="提交数据" name="submit" /></li> 
        </ul>
    </form>
{{else}}
	<form action="../index.php" method="post" id="form1" enctype="multipart/form-data">
        <ul>
            <li>姓名:{{$info_update.name}}</li>
            <li>学历:<input type="text" name="xueli" value="{{$info_update.xueli}}" /></li>
            <li>年龄:{{$info_update.age}}</li>
            <li>上传头像:<input type="file" name="myfile"></li>
            <li>上传文件:<input type="file" name="filedoc" /></li>
            <li><input type="submit" value="修 改" name="edit_sub" />&nbsp;<input type="button" value="返 回" onclick="window.location.href='index.php'" /></li> 
        </ul>
    </form>
{{/if}}
</div> 
<div class="fl w500">
	<table>
    	<tr>
        	<td width="50" align="center">&nbsp;</td>
        	<td width="50" align="center">姓名</td>
            <td width="50" align="center">学历</td>
            <td width="50" align="center">年龄</td>
            <td width="50" align="center">下载</td>
            <td width="100" align="center">操作</td>
        </tr>
        {{if $info}}
            {{foreach from=$info item=value}}
                <tr>
                    <td align="center"><img src="{{$value.portrait}}" /></td>
                    <td align="center">{{$value.name}}</td>
                    <td align="center">{{$value.xueli}}</td>
                    <td align="center">{{$value.age}}</td>
                    <td align="center"><a href="index.php?act=down&FileName={{$value.file_doc}}">{{$value.doc_name}}</a></td>
                    <td align="center"><a href="index.php?edit={{$value.id}}">修改</a><a href="index.php?del={{$value.id}}" onclick="if(confirm('是否删除数据?')){return true}else{return false}">删除</a></td>
                </tr>
            {{/foreach}}
        {{else}}
        	<tr><td colspan="4" align="center">暂无数据,请添加信息!</td></tr>
        {{/if}}
    </table>
</div> 
{{include file="public/footer.html"}}